package cn.xm.lingshi.dao;

import java.util.List;

import cn.xm.lingshi.pojo.DingDan;
import cn.xm.lingshi.pojo.GouWuChe;
import cn.xm.lingshi.pojo.Shop;

/**
 * 订单数据接口
 * @author 魏魁
 *
 */
public interface OrderDao {
	/**
	 * 查询订单或消费记录
	 * @param userid
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public  List<DingDan> queryRecord(int offer, int pageSize,int userid,int type) throws Exception;
	/**
	 * 根据订单编号查询商品
	 * @param orderid
	 * @return
	 * @throws Exception
	 */
	public List<Shop> queryShopByorder(int orderid) throws Exception;
	/**
	 * 将购物车生成订单1
	 * @param cart
	 * @return
	 * @throws Exception
	 */
	public int addOrder(GouWuChe cart,String address)  throws Exception;
	/**
	 * 将购物车生成订单2
	 * @param cart
	 * @return
	 * @throws Exception
	 */
	public int addOrderdetail(int orderid,int shopid,int shopnum)  throws Exception;
	/**
	 * 根据用户编号查询last订单编号
	 * @param orderid
	 * @return
	 * @throws Exception
	 */
	public int queryOrderidByUserid(int userid) throws Exception;
	/**
	 * 根据商品编号修改库存
	 * @param orderid
	 * @return
	 * @throws Exception
	 */
	public int queryKuCunByShopid(int shopid,int kuncun) throws Exception;
	
}
